<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .div{
            width: 400px;
            height: 400px;
            background-color: coral;
        }
        .div2{
            width: 200px;
            height: 200px;
            background-color: rgb(127, 80, 255);
        }
    </style>
</head>
<body>
    <div class="div" id="div">
        <div class="div2"></div>
    </div>
</body>
</html>
<script src="./jquery-3.6.0.js"></script>
<script>
    $(".div").on("click",function(){
        console.log("点击了");
        var oDiv = document.getElementById("div");
        console.log(getComputedStyle(oDiv).backgroundColor ? getComputedStyle(oDiv).backgroundColor : oDiv.currentStyle.backgroundColor);
    })
    $(".div").on("mouseover",function(){
        console.log("移入");
    })
    $(".div").on("mouseout",function(){
        console.log("移出");
    })
    $(".div").on("mouseenter",function(){
        console.log("移入（mouseenter）");
    })
    $(".div").on("mousedown",function(){
        console.log("按下");
    })
    $(".div").on("mouseup",function(){
        console.log("抬起");
    })
    $(".div").on("dblclick",function(){
        console.log("双击");
    })
    $(".div").on("contextmenu",function(){
        console.log("右击");
    })


</script>